home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The 640 MEG Shareware Studio 2
/
The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO
/
prog
/
pas_all.zip
/
TI674.ASC
< prev
next >
Wrap
Text File
|
1992-02-28
|
2KB
|
133 lines
PRODUCT : Turbo Pascal NUMBER : 674
VERSION : 6.0
OS : MS/PC DOS
DATE : February 28, 1992 PAGE : 1/2
TITLE : Change Foreground and Background Color
{
This program will place a new foreground and background color and
pattern on the desktop. It will also set the character that is
displayed for the pattern.
This example: the $05 defines the 0 for black foreground and
the 5 for purple background.
}
program ColorManipulation;
uses
Dos, Objects, Drivers, Memory, Views,
Menus, Dialogs, App;
type
PMyBack = ^TMyBack;
TMyBack = object(TBackground)
constructor Init(var Bounds: TRect);
end;
PMyApp = ^TMyApp;
TMyApp = object(TApplication)
MyBack: PMyBack;
constructor Init;
function GetPalette:PPalette; virtual;
end;
function TMyApp.GetPalette: PPalette;
const
MyBackColor : TPalette = CColor; { sets palette to CColor }
{ items }
begin
MyBackColor[1]:=#$05; { TBackGround Color Constant's first }
{ number is background and second is }
{ foreground }
GetPalette := @MyBackColor;
end;
constructor TMyBack.Init(var Bounds: TRect);
begin
PRODUCT : Turbo Pascal NUMBER : 674
VERSION : 6.0
OS : MS/PC DOS
DATE : February 28, 1992 PAGE : 2/2
TITLE : Change Foreground and Background Color
TBackground.Init(Bounds, '▓');{ places ASCII 178 char as }
{ pattern for text on desktop }
end;
constructor TMyApp.Init;
var
R:TRect;
begin
TApplication.Init;
GetExtent(R);
MyBack:= New(PMyBack, init(R));
Desktop^.Background:= MyBack;
Desktop^.Insert(Desktop^.Background);
end;
var
TheApp: TMyApp;
begin
TheApp.Init;
TheApp.Run;
TheApp.Done;
end.